﻿using System.Collections.Generic;
using System.Web.Mvc;
using PartyInvites.Test.Chart6;
using Ninject;

namespace PartyInvites.Controllers
{
    public class ProductController : Controller
    {
        private IValueCalculator _calc;
        public ProductController(IValueCalculator calcParam)
        {
            _calc = calcParam;
        }
        // GET: Product
        public ActionResult Index()
        {
            IEnumerable<Product> prodducts = new List<Product>()
            {
                new Product()
                {
                    Id = 1,
                    Name = "James",
                    Price = 88M
                }
            };


            var cart = new ShoppingCart(_calc) { Products = prodducts };
            var total = cart.CalculateProductTotal();
            return View(total);
        }
    }
}